/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.hk.media.service;

import java.util.List;
import java.util.Map;

import com.thinkgem.jeesite.common.utils.ImgUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.hk.media.entity.HkMediaCategoryCircle;
import com.thinkgem.jeesite.modules.hk.media.dao.HkMediaCategoryCircleDao;

/**
 * 自媒体圈子Service
 * @author 罗天文
 * @version 2018-05-14
 */
@Service
@Transactional(readOnly = true)
public class HkMediaCategoryCircleService extends CrudService<HkMediaCategoryCircleDao, HkMediaCategoryCircle> {

	public HkMediaCategoryCircle get(String id) {
		return super.get(id);
	}
	
	public List<HkMediaCategoryCircle> findList(HkMediaCategoryCircle hkMediaCategoryCircle) {
		return super.findList(hkMediaCategoryCircle);
	}
	
	public Page<HkMediaCategoryCircle> findPage(Page<HkMediaCategoryCircle> page, HkMediaCategoryCircle hkMediaCategoryCircle) {
		return super.findPage(page, hkMediaCategoryCircle);
	}
	
	@Transactional(readOnly = false)
	public void save(HkMediaCategoryCircle hkMediaCategoryCircle) {
		Map<String,String> map=ImgUtils.getImgWidthHeight(hkMediaCategoryCircle.getCoverImgSrc());
		hkMediaCategoryCircle.setCoverImgWidth(map.get("width"));
		hkMediaCategoryCircle.setCoverImgHeight(map.get("height"));
		super.save(hkMediaCategoryCircle);
	}
	
	@Transactional(readOnly = false)
	public void delete(HkMediaCategoryCircle hkMediaCategoryCircle) {
		super.delete(hkMediaCategoryCircle);
	}
	
}